#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding=utf8

# 本文件由自动工具 proto.py 自动生成，请勿修改
# filename msg12000_csbuf.py
# package ptl

from ptl.base_csbuf import *


# message Req12001
class Req12001:
	def __init__(self):
		self.protoid = 12001
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp12001
class Resp12001:
	def __init__(self):
		self.protoid = 12001
		self.list = []

	def Marshal(writer):
		countlist = len(self.list)
		writer.setArray(countlist, 1)
		for i in range(countlist):
			writer.setMessage(0)
			self.list[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = MailTitle() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.list.append(msg)
# message Req12002
class Req12002:
	def __init__(self):
		self.protoid = 12002
		self.mailId = 0

	def Marshal(writer):
		writer.setUint64(self.mailId, 1)

	def Unmarshal( reader):
		self.mailId = reader.getUint64(1)
# message Resp12002
class Resp12002:
	def __init__(self):
		self.protoid = 12002
		self.mail = MailBody()

	def Marshal(writer):
		writer.setMessage(1)
		self.mail.Marshal(writer)
		writer.endSetMessage()

	def Unmarshal( reader):
		reader.getMessage(1)
		self.mail.Unmarshal(reader)
		reader.endGetMessage()
# message Req12003
class Req12003:
	def __init__(self):
		self.protoid = 12003
		self.mailId = 0

	def Marshal(writer):
		writer.setUint64(self.mailId, 1)

	def Unmarshal( reader):
		self.mailId = reader.getUint64(1)
# message Resp12003
class Resp12003:
	def __init__(self):
		self.protoid = 12003
		self.status = 0

	def Marshal(writer):
		writer.setUint8(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
# message Req12004
class Req12004:
	def __init__(self):
		self.protoid = 12004
		self.mailId = 0

	def Marshal(writer):
		writer.setUint64(self.mailId, 1)

	def Unmarshal( reader):
		self.mailId = reader.getUint64(1)
# message Resp12004
class Resp12004:
	def __init__(self):
		self.protoid = 12004
		self.items = []
		self.status = 0

	def Marshal(writer):
		countitems = len(self.items)
		writer.setArray(countitems, 1)
		for i in range(countitems):
			writer.setMessage(0)
			self.items[i].Marshal(writer)
			writer.endSetMessage()
		writer.setUint8(self.status, 2)

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = MailItem() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.items.append(msg)
		self.status = reader.getUint8(2)
